﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;

namespace PayRoller.Code
{
    public static class DataBaseLoger
    {
        public static void SaveExcuteInfo(string logName,string logInfo)
        {
            using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["SQLConnString"]))
            {
                conn.Open();
                using (SqlCommand comm = new SqlCommand())
                {
                    comm.Connection = conn;
                    comm.CommandText = string.Format("INSERT INTO [TaskExcuteInfo] ([TaskName],[ExcuteTime],[memo]) VALUES ('{0}','{2}','{1}')",logName,logInfo,DateTime.Now.ToString());
                    comm.ExecuteNonQuery();
                }
            }
        }
    }
}
